<?php
class Employee {
	public $name;
	public $city;
	protected $wage;
	
	function __get($propName) {
		echo "__get($propName) called!";
		echo "\n";
		
		$vars = array("name", "city");
		
		if (in_array($propName, $vars)){
			return $this->$propName;
		}else {
			return "No such variable!";
		}
	}
}

$employee = new Employee();
$employee-> name= "Tommy";

echo $employee-> name."\n";
echo $employee-> age;

?>